package com.bw.common.adapter

import android.graphics.Color
import android.graphics.drawable.GradientDrawable
import android.widget.TextView
import com.bw.common.R
import com.bw.common.entity.SeleteEntity
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class SeleteAdapter : BaseQuickAdapter<SeleteEntity, BaseViewHolder>(R.layout.item_selete) {
    override fun convert(holder: BaseViewHolder, item: SeleteEntity) {
        val view = holder.getView<TextView>(R.id.sel)
        view.text = item.title
        val drawable = GradientDrawable()
                drawable.cornerRadius = 15f
                view.background = drawable

        if (item.isSelect){
            view.setTextColor(Color.parseColor("#4A9EE7"))
            drawable.setColor(Color.parseColor("#E8F3FC"))
        }else{
            view.setTextColor(Color.parseColor("#717985"))
            drawable.setColor(Color.parseColor("#F3F4F6"))
        }

    }
}